/* NPC:     Thomas Swift
 * Purpose: Amoria warper.
 * Author:  Buya
*/
void npc(Player @player, NPC @npc) {
int state = npc.getState();
int map = player.getMap().getID();
if(map == 100000000) {
if(state == 0) {
npc.addText("I can take you to the Amoria Village. Are you ready to go?");
npc.sendYesNo();
}
else if(state == 1) {
if(npc.getSelected() == YES) {
npc.addText("I hope you had a great time! See you around!");
npc.sendNext();
player..changeMap(680000000);
npc.end();
} else {
npc.addText("Ok, feel free to hang around until you're ready to go!");
npc.sendNext();
npc.end(); 
}
}
} else {
if(state == 0) {
npc.addText("I can take you back to your original location. Are you ready to go?");
npc.sendYesNo();
}
else if(state == 1) {
if(npc.getSelected() == YES) {
player.changeMap(100000000);
} else {
npc.addText("Ok, feel free to hang around until you're ready to go!");
npc.sendNext();
}
npc.end();
}
}
}